
package com.j2eefast.flowable.bpm.service;


import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.j2eefast.common.core.mutidatasource.annotaion.DataSource;
import com.j2eefast.common.core.page.Query;
import com.j2eefast.common.core.utils.PageUtil;

//import com.j2eefast.flowable.bpm.entity.ManagerUserEntity;
import com.j2eefast.flowable.bpm.entity.UserEntity;

//import com.j2eefast.flowable.bpm.mapper.ManagerMapper;
import com.j2eefast.flowable.bpm.mapper.ManagerMapper;
import com.j2eefast.flowable.bpm.mapper.UserMapper;
import com.j2eefast.framework.sys.entity.ManagerUserEntity;
import com.j2eefast.framework.sys.entity.SysUserEntity;
import com.j2eefast.framework.sys.mapper.SysUserMapper;
import com.j2eefast.framework.utils.Constant;
import org.aspectj.lang.annotation.After;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

import java.io.Serializable;
import java.util.Map;


/**
 * <p></p>
 *
 * @author: zhangyuan
 * @date: 2021-04-29 23:47
 * @web: http://www.letukeji.cn
 * @version: 1.0.1
 */


@Service
//@Transactional(readOnly = true)
public class ManagerService extends ServiceImpl<ManagerMapper, ManagerUserEntity> {

	@Resource
	protected ManagerMapper managerMapper;

	@Resource
	private SysUserMapper sysUserMapper;

	//@DataSource(name = "master")
	public PageUtil managersList(Map<String, Object> params) {
		Page<ManagerUserEntity> page = managerMapper.managersList(	new Query<ManagerUserEntity>(params).getPage(),
				(String) params.get(Constant.SQL_FILTER));
		return new PageUtil(page);
	}

	//@DataSource(name = "master")
	public ManagerUserEntity getManager(Long id){
		return managerMapper.getManager(id);
	}

	//@DataSource(name = "master")
	public  boolean updateByIds(ManagerUserEntity managerUserEntity){
		return managerMapper.updateByIds(managerUserEntity);
	}


}
